<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>健康证信息修改系统</title>
    <link rel="stylesheet" href="css/styles.css">
</head>
<body>
    <div class="container single-panel">
        <div class="edit-section">
            <h2>健康证信息修改</h2>
            <form id="healthCardForm">
                <div class="form-group">
                    <label for="name">姓名：<span class="required">*</span></label>
                    <input type="text" id="name" name="name" required>
                </div>
                <div class="form-group">
                    <label for="gender">性别：<span class="required">*</span></label>
                    <select id="gender" name="gender" required>
                        <option value="男">男</option>
                        <option value="女">女</option>
                    </select>
                </div>
                <div class="form-group">
                    <label for="id">编号：<span class="required">*</span></label>
                    <div style="display:flex;gap:5px;">
                        <input type="text" id="id" name="id" value="Y21348058437" required style="flex:1;">
                        <button type="button" id="randomIdBtn" style="width:auto;padding:5px 10px;">随机</button>
                    </div>
                </div>
                <div class="form-group">
                    <label for="age">年龄：<span class="required">*</span></label>
                    <input type="number" id="age" name="age" min="1" max="120" required>
                </div>
                <div class="form-group">
                    <label for="type">类型：<span class="required">*</span></label>
                    <input type="text" id="type" name="type" value="食品卫生" required>
                </div>
                <div class="form-group">
                    <label for="jobType">工种：<span class="required">*</span></label>
                    <input type="text" id="jobType" name="jobType" value="流通领域" required>
                </div>
                <div class="form-group">
                    <label for="issueDate">发证日期：<span class="required">*</span></label>
                    <input type="date" id="issueDate" name="issueDate" required>
                </div>
                <div class="form-group">
                    <label for="validDate">有效日期：<span class="required">*</span></label>
                    <input type="date" id="validDate" name="validDate" required>
                </div>
                <div class="form-group">
                    <label for="result">体检结果：<span class="required">*</span></label>
                    <input type="text" id="result" name="result" value="合格" required>
                </div>
                <div class="form-group">
                    <label for="unit">单位：<span class="required">*</span></label>
                    <input type="text" id="unit" name="unit" value="美团外卖" required>
                </div>
                <div class="form-group">
                    <label for="hospital">检查机构：<span class="required">*</span></label>
                    <input type="text" id="hospital" name="hospital" value="玉二医健共体集团清港分院" required>
                </div>
                <div class="form-group">
                    <label for="photo">照片：</label>
                    <input type="file" id="photo" name="photo" accept="image/*">
                </div>
                <div class="form-group">
                    <label for="stamp">盖章图片：</label>
                    <input type="file" id="stamp" name="stamp" accept="image/*">
                </div>
                <div class="form-group button-group">
                    <button type="button" id="saveDataBtn">保存信息</button>
                    <button type="button" id="previewBtn">查看预览</button>
                    <a href="javascript:void(0);" id="queryAllBtn" class="query-all-btn">查询</a>
                </div>
            </form>
        </div>
    </div>

    <script src="js/api.js"></script>
    <script src="js/edit.js"></script>
    <script>
        // 查询按钮点击事件，添加时间戳确保重新加载
        document.getElementById('queryAllBtn').addEventListener('click', function() {
            const timestamp = new Date().getTime();
            window.location.href = 'query.html?t=' + timestamp;
        });
    </script>
</body>
</html> 